package com.luo.testtouch.publicview;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.widget.FrameLayout;


public class MyFrameLayout extends FrameLayout
{
     
	private static final String MY_FRAME_LAYOUT = "MyFrameLayout";

	public MyFrameLayout(Context context, AttributeSet attrs)
	{
		super(context, attrs);
		// TODO Auto-generated constructor stub
	}
	
	
	
	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec)
	{
		super.onMeasure(widthMeasureSpec, heightMeasureSpec);
		int hh = this.getMeasuredHeight();
//		Log.i("luo_debug", "frame getMeasuredHeight==="+hh);
	}
	
	
	@Override
	protected void onLayout(boolean changed, int left, int top, int right,
			int bottom)
	{
//		Log.i("luo_debug", " frame onLayout"+changed);
		if(changed){
//			changed
		}
		// TODO Auto-generated method stub
		super.onLayout(changed, left, top, right, bottom);
	}
	
	
    @Override
    protected void dispatchDraw(Canvas canvas)
    {
//    	Log.i("luo_debug", " frame dispatchDraw");
    	// TODO Auto-generated method stub
    	super.dispatchDraw(canvas);
    	
    }
	
	
    @Override
    public boolean onInterceptTouchEvent(MotionEvent ev)
    {
    	Log.i(GUitl.Log_TAG, MY_FRAME_LAYOUT +"-----onInterceptTouchEvent enter");
    	boolean res = super.onInterceptTouchEvent(ev);
    	
    	
    	Log.i(GUitl.Log_TAG, MY_FRAME_LAYOUT +"-----onInterceptTouchEvent =="+res);
		return res;
    }
    @Override
    public boolean onTouchEvent(MotionEvent event)
    {
    	boolean res = super.onTouchEvent(event);

    	
    	Log.i(GUitl.Log_TAG, MY_FRAME_LAYOUT +"----onTouchEvent=="+res);
		return res;
    }
    
    @Override
    public boolean dispatchTouchEvent(MotionEvent ev)
    {
    	Log.i(GUitl.Log_TAG, MY_FRAME_LAYOUT +"----dispatchTouchEvent enter");
    	boolean res = super.dispatchTouchEvent(ev);
    	
    	
    	Log.i(GUitl.Log_TAG, MY_FRAME_LAYOUT +"-----dispatchTouchEvent===="+res);
		return res;
    }

}
